﻿@model GameSchool.Models.StudentDashboardViewModel

@{
    ViewBag.Title = "Student Course | GameSchool";
    Layout = "~/Views/Shared/_LayoutStudent.cshtml";
}

    <div class="mainSectionStuff">
        <h2>Upcoming Deadlines</h2>       
        <ul class="deadLinesList">
            @foreach (var item in Model.deadlines)
            {    
                <li class="deadlineLI"> @item.taskType</li>
                <li>Level: @item.level.AsInt() | Days left: @item.daysLeft</li>
            } 
        </ul>
    </div>
       <div class="mainSectionStuff">
        <h2>Overview of @Model.courseName</h2>
            <table class="studentProgressTable">
                <caption>@Model.courseName</caption>
                <thead>
                <tr>
		            <th class="scoreBelow">Student below</th>
		            <th class="scoreYour">Your Score</th>
		            <th class="scoreAbove">Student Above</th>
	            </tr>
            </thead>
            <tbody>
	            <tr>                    
                    @if (Model.progressOverview.xpAboveStudent == 0)
                    {
                        <td class="scoreBelow">@Model.progressOverview.xpBelowStudent XP</td>                        
		                <td class="scoreYour">@Model.progressOverview.currentXPInCourse XP</td>
		                <td class="scoreAbove">-</td>
                    }
                    else if (Model.progressOverview.xpBelowStudent == 0)
                    {
                        <td class="scoreBelow">-</td>                        
                        <td class="scoreYour">@Model.progressOverview.currentXPInCourse XP</td>
                        <td class="scoreAbove">@Model.progressOverview.xpAboveStudent XP</td>
                    }
                    else
                    {
                        <td class="scoreBelow">@Model.progressOverview.xpBelowStudent XP</td>                        
                        <td class="scoreYour">@Model.progressOverview.currentXPInCourse XP</td>
                        <td class="scoreAbove">@Model.progressOverview.xpAboveStudent XP</td>
                    }
                </tr>
            </tbody>	
        </table>   
        <div class="levelIndicator">
            <p>I've completed <span class="myLevels">@Model.progressOverview.currentLevelInCourse</span> levels out of <span class="totalLevels">@Model.progressOverview.totalLevelsInCourse</span></p>
        </div>
    </div>
    <div class="mainSectionStuff">               
        <h2>Latest Achievements</h2>
        <ul>
            @foreach (var item in Model.listAchievements)
            {
                if (@item.achievementID == 1)
                {
                    <li>Achievement Name: @item.title<img src="http://stickers.classroomcapers.co.uk/catalog/product/cache/1/image/265x265/5e06319eda06f020e43594a9c230972d/T/1/T11013LRG.jpg" alt="prize" width="200px" height="200px"/> </li>
                }
                else if (@item.achievementID == 2)
                {
                    <li>Achievement Name: @item.title <img src="http://casualgamerchick.com/wp-content/uploads/2007/06/achievement.jpg" alt="prize" width="200px" height="200px" /> </li>
                }
                else if (@item.achievementID == 3)
                {
                    <li>Achievement Name: @item.title <img src="http://us.123rf.com/400wm/400/400/snake3d/snake3d1108/snake3d110800018/10375234-golden-medal-first-place-award-champion-winner-achievement-pride-badge-design-element-the-best-numbe.jpg" alt="prize" width="200px" height="200px" /> </li>
                }
                else
                { @* default achievement image *@
                    <li>Achievement Name: @item.title <img src="http://us.cdn3.123rf.com/168nwm/snake3d/snake3d1108/snake3d110800038/10444977-golden-award-first-place-medal-badge-winner-achievement-pride-symbol-number-one-quality-success-conc.jpg" alt="prize" width="200px" height="200px" /> </li>
                }
            }
        </ul>    
    </div>
 
    


<ul>
    @section menu{
        <li>@Html.ActionLink("Courses Overview", "StudentHome", "Student")</li> 
        <li>@Html.ActionLink("Assignment", "ViewAssignmentsInCourse", "Assignment", new { CID = Model.courseID }, null)</li>    
        <li>@Html.ActionLink("Online Exam", "ViewExam", "Exam", new { CID = Model.courseID }, null)</li>
        <li>@Html.ActionLink("Lecture", "ViewLecturesInCourse", "Lecture", new { CID = Model.courseID }, null)</li>
        <li>@Html.ActionLink("Description", "CourseDescription", "Course", new { CID = Model.courseID }, null)</li>
    }
</ul>